<% import grails.persistence.Event %>
<%=packageName%>

<%
                          excludedProps = Event.allEvents.toList() << 'version'
                            props = domainClass.properties.findAll { !excludedProps.contains(it.name) && it.type != Set.class }
                            if(listItems){
                              Collections.sort(props, wcomparator.constructors[0].newInstance([domainClass, listItems] as Object[]))

                            }else{
                            Collections.sort(props, comparator.constructors[0].newInstance([domainClass] as Object[]))
                            }
                          props.eachWithIndex { p, i ->
                                cp = domainClass.constrainedProperties[p.name]
                                if (!listItems || listItems.find{item -> item.equals(p.name)}  ) {
                                    if (p.type == Boolean.class || p.type == boolean.class) { %>
                              <div class="pseudoTableCel \${(i % 2) == 0 ? 'odd' : 'even'}"><g:formatBoolean boolean="\${${propertyName}.${p.name}}" /></div>
                        <%          } else if (p.type == Date.class || p.type == java.sql.Date.class || p.type == java.sql.Time.class || p.type == Calendar.class) { %>
                             <div class="pseudoTableCel \${(i % 2) == 0 ? 'odd' : 'even'}"><g:formatDate date="\${${propertyName}.${p.name}}" /></div>
                        <%          } else if (p.isAssociation()) { %>
                             <div class="pseudoTableCel \${(i % 2) == 0 ? 'odd' : 'even'}">
                            <g:if test="\${${propertyName}.${p.name}}">
                             \${${propertyName}.${p.name}.size()}
                            <g:remoteLink action="list${p.name}" update="div_data_${p.name}_\${${propertyName}.id}" id="\${${propertyName}.id}" after="showHideDataRow('div_data_${p.name}_\${${propertyName}.id}')">...</g:remoteLink>
                           </g:if>
                            <g:if test="\${!${propertyName}.${p.name}}"> &nbsp;</g:if>
                          </div>
                        <%          } else { %>
                            <div class="pseudoTableCel \${(i % 2) == 0 ? 'odd' : 'even'}">\${fieldValue(bean: ${propertyName}, field: "${p.name}")}</div>
                        <%  }   }   } %>
                          <% if(rowActions){ rowActions.each{ ra -> %>
                              <div class="pseudoTableCel \${(i % 2) == 0 ? 'odd' : 'even'}">
                                  <% if(ra.url) { %>
                                  <a href="${ra.url}">${ra.label}</a>
                                  <% } %>
                                  <% if(ra.action) { %>
                                  <g:link action="${ra.action}" <% if(ra.controller) { %> controller="${ra.controller}" <% } %> id="\${${propertyName}.id}" > <g:message code="${ra.label}" default="${ra.label}" />    </g:link>
                                   <% } %>
                              </div>

                                <% }
                                     }%>

                              <div class="pseudoTableCel \${(i % 2) == 0 ? 'odd' : 'even'}">
                              <g:remoteLink  action="edit"  id="\${${propertyName}.id}"  class="q-edit-button" update="div_edit_\${${propertyName}.id}" after="showHideEditDiv('\${${propertyName}.id}','${domainClass.propertyName}')">
                               <span class="rowactionedit"> \${message(code: 'default.button.edit.label', default: 'Edit')} </span>
                              </g:remoteLink >
                               <g:link action="delete"  id="\${${propertyName}.id}"  class="q-delete-button" onclick="return confirm('\${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');">
                                   <span class="rowactiondelete"> \${message(code: 'default.button.delete.label', default: 'Delete')} </span>
                              </g:link>
                               <g:link action="show"  id="\${${propertyName}.id}" class="q-show-button" >
                                   <span class="rowactioninfo"> \${message(code: 'default.button.detail.label', default: 'Detail')} </span>
                              </g:link>

                              </div>


                      <div id="spacer" class="pseudoTableSpacer"></div>


                        